package top.caoayu.common.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

@Getter
@AllArgsConstructor
public enum ResponseBody {
    SUCCESS("200", "success"),
    FAIL("500", "fail"),

    HTTP_STATUS_200("200", "ok"),
    HTTP_STATUS_400("400", "bad request"),
    HTTP_STATUS_401("401", "unauthorized"),
    HTTP_STATUS_403("403", "forbidden"),
    HTTP_STATUS_404("404", "not found"),
    HTTP_STATUS_500("500", "internal server error"),
    HTTP_STATUS_502("502", "bad gateway"),
    HTTP_STATUS_503("503", "service unavailable"),
    HTTP_STATUS_504("504", "gateway timeout");

    public static final List<ResponseBody> HTTP_STATUS_ALL = Collections.unmodifiableList(
            Arrays.asList(HTTP_STATUS_200, HTTP_STATUS_401, HTTP_STATUS_400, HTTP_STATUS_404, HTTP_STATUS_403, HTTP_STATUS_502, HTTP_STATUS_500, HTTP_STATUS_503, HTTP_STATUS_504)
    );

    private final String code;
    private final String message;
}
